package com.controller;

import com.milo.OpcUAClientRunner;
import com.milo.OpcUAClientService;
import com.service.ServiceFunction;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Controller;

/**
 * @author Linjiapeng
 * @date 2023.11.08

 */
@Controller
public class RunDemo {

    private static final Logger logger = LoggerFactory.getLogger(RunDemo.class);




    @Autowired
    private  OpcUAClientService opcUAClientService;

    /**
     * 获取数据（0、1号机组）
     */

    public static void main(String[] args){

        ApplicationContext ac = new
                ClassPathXmlApplicationContext("applicationContext.properties");
        RunDemo runDemo = ac.getBean(RunDemo.class);

        logger.info("开始运行代码：");

        new OpcUAClientRunner(runDemo.opcUAClientService).run();
    }

}



